#pragma once

template <typename Generator, typename Freq, typename Ampl>
class Vibrato
{
public:
    Vibrato(): time_(0) {}
    float operator()()
    {
        ++time_;
        const float in = in_();
        return in + ampl_() * in * sin(2 * 3.1415926536 * freq_() * time_ / SAMPLE_RATE);
    }
private:
    Generator in_;
    Freq freq_;
    Ampl ampl_;
    int time_;
};


